@extends('index.layouts.app')
@section('title', $user->name . ' 的个人中心')
@section('content')
  <div class="row">

    <div class="col-lg-3 col-md-3 hidden-sm hidden-xs user-info">
      <div class="card ">
        <img class="card-img-top" src="{{ Auth::user()->avatar }}" alt="{{ $user->name }}">
        <div class="card-body">
          <h5><strong>个人简介</strong></h5>
          <p>{{ $user->introduction }} </p>
          <hr>
          <h5><strong>注册于</strong></h5>
          <p>{{ $user->created_at->diffForHumans() }}</p>
          <hr>
          <h5><strong>最后活跃</strong></h5>
          <p title="{{  $user->last_actived_at }}">{{ $user->last_actived_at->diffForHumans() }}</p>
        </div>
      </div>
    </div>
    <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
      <div class="card">
        <div class="card-header">
          每日一句
        </div>
        <div class="card-body">
          <blockquote class="blockquote mb-0">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
            <footer class="blockquote-footer">{{$user->name}} <cite title="Source Title"><span style="color: #e27575;font-size: 14px;">❤</span></cite></footer>
          </blockquote>
        </div>
      </div>
      <hr>
      {{-- 用户发布的内容 --}}
{{--      <div class="card ">--}}

{{--        <div class="card-body">--}}
{{--           @if (Auth::check())--}}
{{--             @include('community.shared.shared._follow_form')--}}
{{--           @endif--}}
{{--           <section class="status">--}}
{{--             @if ($statuses->count() > 0)--}}
{{--               <ul class="list-unstyled">--}}
{{--                 @foreach ($statuses as $status)--}}
{{--                   @include('community.shared.shared._status')--}}
{{--                 @endforeach--}}
{{--               </ul>--}}
{{--               <div class="mt-5">--}}
{{--                 {!! $statuses->render() !!}--}}
{{--               </div>--}}
{{--             @else--}}
{{--               <p>没有数据！</p>--}}
{{--             @endif--}}
{{--        </div>--}}
{{--      </div>--}}
      <div class="card ">
        <div class="card-body">
          <ul class="nav nav-tabs">
            <li class="nav-item">
              <a class="nav-link bg-transparent {{ active_class(if_query('tab', null)) }}" href="{{ route('users.show', $user->id) }}">
                Ta 的话题
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link bg-transparent {{ active_class(if_query('tab', 'replies')) }}" href="{{ route('users.show', [$user->id, 'tab' => 'replies']) }}">
                Ta 的回复
              </a>
            </li>
          </ul>
          @if (if_query('tab', 'replies'))
            @include('index.shared._replies', ['replies' => $user->replies()->with('topic')->recent()->paginate(5)])
          @else
            @include('topics.shared._topics', ['topics' => $user->topics()->recent()->paginate(5)])
          @endif
        </div>
      </div>

    </div>
  </div>
@stop
